//
//  AudioPlayer.h
//  XiMaLaYaFM
//
//  Created by MJL on 15/10/16.
//  Copyright (c) 2015年 马金丽. All rights reserved.
//

#import <Foundation/Foundation.h>
@class AudioPlayer;

/**
 *  声明协议
 */
@protocol AudioPlayerDelegate <NSObject>

@optional
//播放中一直执行
- (void)playWithPlayer:(AudioPlayer *)player withProgress:(CGFloat)progress;

//播放结束
- (void)playEndFinish:(AudioPlayer *)palyer;

@end

@interface AudioPlayer : NSObject

#pragma mark 声明协议的属性
@property(nonatomic,assign)id<AudioPlayerDelegate>delegate;

#pragma mark 声明计时器的属性
@property(nonatomic,strong)NSTimer *timer;
//记录播放状态
@property(nonatomic,assign)BOOL isPlaying;



/**
 *  创建单例
 */

+ (instancetype)sharedInstance;
//准备播放的网址
- (void)prepareWithUrl:(NSString *)strinfUrl;
//播放
- (void)play;
//暂停
- (void)pause;
//停止
- (void)stop;
//从指定时间开始播放
- (void)seekToTime:(float)time;

@end
